using System;
using System.Collections.Generic;
using System.Text;

using NHibernate;
using NHibernate.Data.Models;
using NHibernate.Data.Base;

namespace NHibernate.Data.Managers
{
    public partial interface IAwardManager : IManagerBase<Award, long>
    {
		// Get Methods
		IList<Award> GetByInstitution(System.Int64 institution);
		IList<Award> GetByIntroduction(System.Int64 introduction);
		IList<Award> GetByLocalName(System.Int64 localName);
    }

    partial class AwardManager : ManagerBase<Award, long>, IAwardManager
    {
		#region Constructors
		
		public AwardManager() : base()
        {
        }
        public AwardManager(INHibernateSession session) : base(session)
        {
        }
		
		#endregion
		
        #region Get Methods

		
		public IList<Award> GetByInstitution(System.Int64 institution)
        {
            ICriteria criteria = Session.GetISession().CreateCriteria(typeof(Award));
			
			criteria.Add(NHibernate.Criterion.Expression.Eq("Institution", institution));
			
			return criteria.List<Award>();
        }
		
		public IList<Award> GetByIntroduction(System.Int64 introduction)
        {
            ICriteria criteria = Session.GetISession().CreateCriteria(typeof(Award));
			
			criteria.Add(NHibernate.Criterion.Expression.Eq("Introduction", introduction));
			
			return criteria.List<Award>();
        }
		
		public IList<Award> GetByLocalName(System.Int64 localName)
        {
            ICriteria criteria = Session.GetISession().CreateCriteria(typeof(Award));
			
			criteria.Add(NHibernate.Criterion.Expression.Eq("LocalName", localName));
			
			return criteria.List<Award>();
        }
		
		#endregion
    }
}